@echo off
rem This is a batch processing file to build the dll.
rem version 1.0.7 (29/4/2012)
echo.
echo 1 - Copying the sources from \src to the current directory
echo     Current directory is ..\MD_DLL\compile
cd ..
cd src
xcopy *.f ..\compile\ /y /q
echo. 
cd ..
cd compile
echo.
echo 2 - Beginning to compile files
echo.
echo Processing dcmd_cmod.f ... [01/20]: DCMD common module
call aspcomp dcmd_cmod.f
echo Processing com_tool.f  ... [02/20]: Diagnosis and file output
call aspcomp com_tool.f
echo Processing dcmdvars.f  ... [03/20]: Aspen User Unit Lib definition
call aspcomp dcmdvars.f
echo Processing com_subs.f  ... [04/20]: Common functions
call aspcomp com_subs.f
echo Processing dcmd_estw.f ... [05/20]: Estimation of wall properties
call aspcomp dcmd_estw.f
echo Procssing dcmd_flux.f  ... [06/20]: Computation of heat and mass
call aspcomp dcmd_flux.f
echo Processing dcmd_solv.f ... [07/20]: DCMD calculation at the node
call aspcomp dcmd_solv.f
echo Processing dcmd_main.f ... [08/20]: Main program of DCMD
call aspcomp dcmd_main.f
echo Processing dogleg.f    ... [09/20]: Supplement of nonlinear equations
call aspcomp dogleg.f
echo Processing dpmpar.f    ... [10/20]: Supplement of nonlinear equations
call aspcomp dpmpar.f
echo Processing enorm.f     ... [11/20]: Supplement of nonlinear equations
call aspcomp enorm.f
echo Processing fdjac1.f    ... [12/20]: Supplement of nonlinear equations
call aspcomp fdjac1.f
echo Processing qform.f     ... [13/20]: Supplement of nonlinear equations
call aspcomp qform.f
echo Processing qrfac.f     ... [14/20]: Supplement of nonlinear equations
call aspcomp qrfac.f
echo Processing r1mpyq.f    ... [15/20]: Supplement of nonlinear equations
call aspcomp r1mpyq.f
echo Processing r1updt.f    ... [16/20]: Supplement of nonlinear equations
call aspcomp r1updt.f
echo Processing hybrd.f     ... [17/20]: Solver of nonlinear equations
call aspcomp hybrd.f
echo Processing hybrd1.f    ... [18/20]: Driver of hybrd.f
call aspcomp hybrd1.f
echo Processing ode.f       ... [19/20]: Solver of odes
call aspcomp ode.f
echo Process dcmd.f         ... [20/20]: Aspen interface program
call aspcomp dcmd.f
echo.
echo Compilation finished ...
echo.
echo 3 - Moving object files to object folder
echo.
xcopy *.obj obj\ /y /q
xcopy *.mod obj\ /y /q
del *.obj
del *.mod
del *.f
echo Moving finished ...
echo.
echo 4 - Linking the object files into dynamic linked library
echo.
cd obj
call asplink dcmd
echo.
echo 5 - Copying dcmd.dll to the parent directory
xcopy dcmd.dll ..\ /y /q
cd ..
xcopy dcmd.dll ..\output /y /q
del dcmd.dll
echo.
echo Finished
